﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace An_Im.Xml
{
    internal static class ExtendXmlHelper
    {
        public static void AppendChildren(this XmlNode xmlNode, params XmlNode[] list)
        {
            foreach (XmlNode node in list)
            {
                xmlNode.AppendChild(node);
            }
        }

        public static XmlElement CreateElementWithValue(this XmlDocument xmldoc, string elename, object innerobj)
        {
            var xmlele = xmldoc.CreateElement(elename);
            if (innerobj != null)
                xmlele.InnerText = innerobj.ToString();
            else
                xmlele.InnerText = "0";
            return xmlele;
        }

    }
}
